package com.mq.colony;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author ytj
 * @date 2024/1/17
 */
@Component
public class ColonyProducer {
    @Resource
    private RabbitTemplate rabbitTemplate;

    public void send(Integer id){
        ColonyMessage colonyMessage=new ColonyMessage(id);
        this.rabbitTemplate.convertAndSend(ColonyMessage.EXCHANGE,null,colonyMessage);
    }
}
